<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<HTML>
<head>
    <c:set var="root" value="${pageContext.request.contextPath}"/>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="${root}/css3/Style1.css" rel="stylesheet" type="text/css" />
    <link href="${root}/css3/common.css" rel="stylesheet" type="text/css"/>
    <script src="${root}/js3/public.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css2/bootstrap.min.css" type="text/css"/>
    <script src="${pageContext.request.contextPath}/js2/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/js2/bootstrap.min.js" type="text/javascript"></script>
    <!-- 引入自定义css文件 style.css -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css2/style.css" type="text/css"/>
    <script>
        function categoryAddUI() {
                window.location.href="${root}/categoryAddUI";
        }
    </script>
</head>
<body>
<br>
<form id="Form1" name="Form1" action="" method="post">
    <table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
        <TBODY>
        <tr>
            <td class="ta_01" align="center" bgColor="#afd1f3">
                <strong>一级分类列表</strong>
            </td>
        <tr>
            <td class="ta_01" align="right">
            <button type="button" id="add" value="添加" class="button_add" onclick="categoryAddUI()">
                &#28155;&#21152;
            </button>
            </td>
        </tr>
        </tr>
        <tr>
            <td class="ta_01" align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
                        <td align="center">
                            序号
                        </td>

                        <td align="center">
                            一级分类名
                        </td>

                        <td align="center">
                            编辑
                        </td>

                        <td align="center">
                            删除
                        </td>

                        <c:forEach var="list" items="${category}" varStatus="status">
                            <tr onmouseover="this.style.backgroundColor = 'white'" onmouseout="this.style.backgroundColor = '#F5FAFE';">
                                <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="5px">
                                      ${status.count}
                                </td>

                                <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="10px">
                                       ${list.cname}
                                </td>

                                <td style="CURSOR: hand; HEIGHT: 22px" align="center" width="10px">
                                    <a href="${root}/manage/editOneProduct.do?cid=${list.cid}"> 编辑 </a>
                                </td>

                                <td align="center" style="HEIGHT: 22px">
                                    <a href="${root}/CategoryDelete?cid=${list.cid}" onclick="return confirm('确定要删除吗？')" >
                                        <img src="${root}/static/images/8/i_del.gif" width="16" height="16" border="0" style="CURSOR: hand">
                                    </a>
                                </td>
                            </tr>
                        </c:forEach>
                </table>
            </td>
        </tr>
        </TBODY>
    </table>
</form>
<nav aria-label="Page navigation" >
  <ul class="pagination" style="margin-left: 40%">
    <c:if test="${page.isFirstPage == true}">
      <li class="disabled">
        <a href="#" aria-label="Previous">
          <span aria-hidden="true">首页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isFirstPage != true}">
      <li>
        <a href="/manage/displayOneProduct.do?pageNum=0" aria-label="Previous">
          <span aria-hidden="true">首页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isFirstPage == true}">
      <li class="disabled">
        <a href="#" aria-label="Previous">
          <span aria-hidden="true">上一页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isFirstPage != true}">
      <li>
        <a href="/manage/displayOneProduct.do?pageNum=${page.prePage}" aria-label="Previous">
          <span aria-hidden="true">上一页</span>
        </a>
      </li>
    </c:if>
    <c:forEach begin="${page.navigateFirstPage}" end="${page.navigateLastPage}" var="item" step="1">
      <c:if test="${item == page.pageNum}">
        <li class="active">
          <a href="/manage/displayOneProduct.do?pageNum=${item}">${item}</a>
        </li>
      </c:if>
      <c:if test="${item != page.pageNum}">
        <li>
          <a href="/manage/displayOneProduct.do?pageNum=${item}">${item}</a>
        </li>
      </c:if>
    </c:forEach>
    <c:if test="${page.isLastPage == true}">
      <li class="disabled">
        <a href="#" aria-label="Next">
          <span aria-hidden="true">下一页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isLastPage != true}">
      <li>
        <a href="/manage/displayOneProduct.do?pageNum=${page.nextPage}" aria-label="Next">
          <span aria-hidden="true">下一页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isLastPage == true}">
      <li class="disabled">
        <a href="#" aria-label="Next">
          <span aria-hidden="true">尾页</span>
        </a>
      </li>
    </c:if>
    <c:if test="${page.isLastPage != true}">
      <li>
        <a href="/manage/displayOneProduct.do?pageNum=${page.pages}" aria-label="Next">
          <span aria-hidden="true">尾页</span>
        </a>
      </li>
    </c:if>
  </ul>
</nav>
</body>
</HTML>

